<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>checkbox validation single using example</title>
    <script src="../../../node_modules/vue/dist/vue.js"></script>
    <script src="../../../dist/vue-validator.js"></script>
    <style>
      input.invalid { border-color: red; }
      .errors { color: red; }
    </style>
  </head>
  <body>
    <div id="app">
      <validity field="term" 
                ref="validity" 
                v-model="validation" 
                :validators="{ required: { message: requiredErrorMsg } }"
      >
        <input id="term" type="checkbox" @change="$refs.validity.validate()">
      </validity>
      <label for="term">I Accept xxx's Terms of Service Agreement.</label>
      <p class="errors" v-if="validation.result.required">{{validation.result.required}}</p>
    </div>
    <script>
      new Vue({
        data: {
          validation: { result: {} }
        },
        computed: {
          requiredErrorMsg: function () {
            return 'Required Terms of Service Agreement checking!!'
          }
        }
      }).$mount('#app')
    </script>
  </body>
</html>
